

                            STITCHING TOGETHER HDR-FILE TILES

I hesitate to call this a script, more of a hack, that needs adjusting to the actual structure
of the chart file. I have converted quite a few charts with the batch script, and have had to
adjust it to the actual file structure. It will normally spit out quite a few error messages
about non-existing files, not to worry.


The name convention is that all files in the second column is named M*chartnumber*.B*.
So you have a "coordinate system" starting with A from left to right, and numbers 
from top to bottom.


The trick is to stitch all the pictures together vertically first, using once again the
second column:
Code:

$convert M*Chartnumber*.B* -append ptest2.pcx

The key is the "-append" which stitches vertically.
To finish the job stitch all the vertical panels together horizontally.
Code:

$convert ptest*  +append new1.pcx

The "+append" stitches horizontally.

WARNING!!!
Make sure that you don't have other files around that can "pollute"  the picture.
For example some charts have header files xxxxxx.HDR, these will mess up the "H" vertical
stripe, unless moved out of the way


						To use these scripts


Put the "chart" batch script one level above the chart directory.
A TIFS and a PNGS directory will be created (if they don't exist), this is where
your pictures will end up.

Stick the join-pcx script in the actual chart directory to be converted. 

In the "chart" batch script change the lines pointing to the chart directory according
to your needs. Don't forget to put the chart(s) you want to convert after the
"for foo in " and on one line with space in between.

These scripts can be changed to suit your needs, for example running the join-pcx script
as a standalone script, with some modification. The main thing is to understand how the convert
command works.


Some chart directories with old Maptech DMA charts contains, whole
charting areas, maybe 20 - 30 charts all in one directory, each consisting 
of maybe 100 tiles. What a mess. To sort this out and get a handle on all the charts
I usually  do 
$ ls *.A01 
in the chart directory. Every  chart contains a file called
*chartnumber*.A01 (top left tile actually), so this gives you a list of charts.
Strip away everything but the chart number in the list, and paste the result on line 2.


Some chart collections have different structure. One example is that the charts have individual
directories containing just their tiles. For an example of how to handle this,
check the batch script "charts2". The idea here is to stick the join-pcx script in
the chart directory that contains the individual chart directories.

2010-01-09
taifun

The scripts are licensed under GPL V2, same as OpenCPN.

